preferredColorScheme

Sets the preferred system appearance (light or dark) for the view hierarchy. Only affects non-transient system overlays.

Type

1preferredColorScheme?: "light" | "dark"

Example

1<NavigationStack>
2  <List preferredColorScheme="dark">
3    <Text>Dark mode view</Text>
4  </List>
5</NavigationStack>